package main

import (
	"fmt"
	"log"
	"os"

	// "github.com/ghodss/yaml"
	"gopkg.in/yaml.v2"
)

type Values struct {
	Deploy map[string]interface{}
}

func main() {

	t := map[string]interface{}{}
	content, err := os.ReadFile("d:/git/goclean/txclould/yamlToJson/service.yaml")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(content))
	err = yaml.Unmarshal(content, &t)
	if err != nil {
		log.Fatalf(err.Error())
	}
	fmt.Printf("%v\n", t)
	fmt.Println(t["spec"])
	fmt.Println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
	t = t["spec"]
	var tt Values
	// switch tt.(type) {
	// case map[string]interface{}:
	// 	op, ok := t.(map[string]interface{})
	// }

}
